<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
>gaichifanle</div>
<input type="text" id="i1">
<input type="button" value="按钮" onclick="f()">
<script>
    function f() {
        //得到文本框和div对象
        let i = document.querySelector("#i1")
        let d = document.querySelector("div")
        //把文本框的值给到div
        d.innerText = i.value;
   }
</script>
</body>
</html>